//
//  TempController.swift
//  BQWB
//
//  Created by laibingqiang on 16/10/22.
//  Copyright © 2016年 laibingqiang. All rights reserved.
//

import UIKit

class TempController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        
        setupUI()
    }
    
    @objc private func pushClink(){

        
        let vc:TempController = TempController()
        
        self.navigationController?.pushViewController(vc, animated: true)
    }
    
//    @objc private func popClink(){
//        
//       _ = self.navigationController?.popViewController(animated: true)
//    }
    
    private func setupUI(){
        
        setupNav()
    }
    
    private func setupNav(){
        
        self.navigationItem.title = "是\(self.navigationController?.childViewControllers.count ?? 0)控制器"
        
//        var tit:String?
//        
//        
//        if self.navigationController?.childViewControllers.count == 2{
//            
//            tit = "首页"
//            
//        }
//        else
//        {
//            tit = "返回"
//        }
//        
//        
//        self.navigationItem.leftBarButtonItem = UIBarButtonItem(target: self, action: #selector(popClink), imgName: "navigationbar_back_withtext", backImg: nil, title: tit)
        
        self.navigationItem.rightBarButtonItem = UIBarButtonItem(target: self, action: #selector(pushClink), imgName: nil, backImg: nil, title: "PUSH")
        
    }

}
